# MessageType and MessagePriority - Determines message types and priorities
# Copyright (C) 2007 Lauri Taimila
# 
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

__licence__ = "GPLv2"
__copyright__ = "2007, Lauri Taimila"
__author__ = "Lauri Taimila <lauri@taimila.com>"

class MessagePriority:
    """
    Simply determines Message priority constants. 
    
    These are used when MessageHandlers are registered to the MessageBus. 
    This definition makes code easy to read.
    """ 
    VERY_HIGH = 0
    HIGH = 10
    NORMAL = 20
    LOW = 30
    VERY_LOW = 40    

class MessageType:
    """
    Determines all allowed Message types. MessageHandler should use these
    to determine type. This simply makes code more readable.
    
    Example: 
        if message.get_type() == MessageType.FRONTEND_OPENED:
            do_something_useful()
    """
    
    # Indicates that Preferences UI has been used to update preferences.
    PREFERENCES_CONF_UPDATED = 0
    
    # Indicates that Content Management UI has been used to update contents.
    CONTENT_CONF_UPDATED = 1
    
    # Indicates that frontend has been opened.
    FRONTEND_OPENED = 2
    
    # Indicates that frontend has been closed.
    FRONTEND_CLOSED = 3
    
    # Indicates that Feed cache has been updated.
    FEED_DB_UPDATED = 4
    
    # Indicates that TV-Guide has been updated.
    GUIDE_DB_UPDATED = 5
    
    # Indicates that recording database has been updated.
    RECORDING_DB_UPDATED = 6
    
    # Indicates that Feed cache should be updated.
    UPDATE_FEEDS = 7
    
    # Indicates that TV-Guide should be updated.
    UPDATE_GUIDE = 8
    
    # Indicates that Weather forecast information should be updated.
    UPDATE_WEATHER = 9
    
    RECORDING_CONFLICT = 10
    RECORDING_STARTED = 11
    RECORDING_STOPPED = 12
    
    # Require to rebuild image cache
    REBUILD_IMAGE_CACHE = 13
    
    # Require to rebuild music cache
    REBUILD_MUSIC_CACHE = 14
    
    # Require to rebuild video cache
    REBUILD_VIDEO_CACHE = 15
    
    # Require to rebuild feed cache
    REBUILD_FEED_CACHE = 16
    
    # Weather information has been updated
    WEATHER_INFO_UPDATED = 17
